package com.commons.validator.vo;

import com.eksframework.commons.core.validator.annotations.DateFormat;
import com.eksframework.commons.core.validator.annotations.DateTimeFormat;
import com.eksframework.commons.core.validator.annotations.TimeFormat;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * FilmVO
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2021-01-08 15:16
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class FilmVO implements Serializable {

    private static final long serialVersionUID = 293951177484354612L;

    @NotBlank(message="{code_not_blank}")
    private String code;

    @NotBlank
    private String name;

    @Size(min=3, max=5, message="value ${validatedValue} should be between [{min},{max}]")
    private List<String> list;

    @NotBlank
    @DateFormat(message = "这个日期不正确")
    private String date;

    @NotBlank
    @TimeFormat(message = "这个时间不正确")
    private String time;

    @NotBlank
    @DateTimeFormat(message = "这个日期时间不正确")
    private String datetime;
}
